package cn.gogpay.dcb.api.dto.qrcode;

import cn.gogpay.dcb.api.entity.GoodsItem;
import cn.gogpay.dcb.api.entity.OrderRecord;
import cn.gogpay.dcb.api.entity.UserBusCard;
import cn.gogpay.dcb.common.util.DateUtils;
import cn.gogpay.dcb.h5base.dto.UserDTO;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotEmpty;
import java.util.Date;

/**
 * 扫描乘车充值
 *
 * @author jiaoming@gogpay.cn
 * @date 2019/11/30 16:52
 */
public class QrCodeChargeDTO {

    /**
     * i许昌平台用户userId
     */
    @NotEmpty(message = "userId不能为空")
    @ApiModelProperty(value = "i许昌平台用户userId", required = true, example = "1xxxxxxx3333ccc1c")
    private String userId;

    /**
     * 公交卡号
     */
    @NotEmpty(message = "cardNo不能为空")
    @ApiModelProperty(value = "公交卡号", required = true, example = "3105072000680000005")
    private String cardNo;
    /**
     * i许昌平台用户手机号
     */
    @NotEmpty(message = "userPhone不能为空")
    @ApiModelProperty(value = "i许昌平台用户手机号", required = true, example = "17785698261")
    private String userPhone;

    /**
     * 充值金额
     */
    @NotEmpty(message = "充值金额不能为空")
    @ApiModelProperty(value = "充值金额", required = true, example = "0.1")
    private String balance;
    /**
     * 交易时间(yyyy-MM-dd HH:mm:ss)
     */
    @NotEmpty(message = "交易时间不能为空")
    @ApiModelProperty(value = "i许昌平台用户userId", required = true, example = "1xxxxxxx3333ccc1c")
    private String dealTime;

    /**
     * 订单编号
     */
    @NotEmpty(message = "订单编号不能为空")
    @ApiModelProperty(value = "订单编号", required = true, example = "8b7455001c8c71c9d2b798bf048ff6e1")
    private String accountNo;

    public QrCodeChargeDTO(OrderRecord record) {
        this.accountNo = record.getId();
        this.cardNo = record.getCardNo();
        this.balance = record.getPrice() + "";
        this.dealTime = DateUtils.format(record.getCreateTime(), "yyyy-MM-dd HH:mm:ss");
        this.userId = record.getUserId();
        this.userPhone = record.getPhone();
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getBalance() {
        return balance;
    }

    public void setBalance(String balance) {
        this.balance = balance;
    }

    public String getDealTime() {
        return dealTime;
    }

    public void setDealTime(String dealTime) {
        this.dealTime = dealTime;
    }

    public String getAccountNo() {
        return accountNo;
    }

    public void setAccountNo(String accountNo) {
        this.accountNo = accountNo;
    }
}
